<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateApplysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('applys', function (Blueprint $table) {
            $table->increments('id');
            $table->enum('apply_type', ['L', 'C'])->default('L')->comment('赛制：L联赛，C杯赛');
            $table->integer('league_id')->default(0)->comment('所属联赛id');
            $table->integer('cup_id')->default(0)->comment('所属杯赛id');
            $table->integer('time')->default(1)->comment('当前联赛或杯赛的第几次比赛');
            $table->integer('max')->default(24)->comment('当前联赛或杯赛的最多报名人数');

            $table->integer('group')->default(2)->comment('分拨数');
            $table->integer('referee')->default(0)->comment('裁判数');
            $table->timestamps();
            $table->date('end_time')->comment('报名截止日期');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('applys');
    }
}
